package com.ms.game.lobby.command;

import com.ms.game.lobby.GameLobbyProcesser;
import com.ms.game.lobby.message.JackpotEventType;
import com.ms.service.module.zone.command.BasicDebugCommand;
import com.ms.service.module.zone.command.CommandHelper;
import com.xpec.c4.game.utility.GameUtility;

/**
 * 測試拉彩公告
 * 
 * @author kvn_yang
 */
public class JackpotNotifyCommand extends BasicDebugCommand {

	/** 公告自己中了遊戲館內獎項 */
	static final private int PARAM_JACKPOT_IN_GAME = 1;

	/** 公告自己中了非遊戲館內的獎項 */
	static final private int PARAM_JACKPOT_NOT_IN_NGAME = 2;

	private CommandHelper helper = new CommandHelper(getName());

	public JackpotNotifyCommand() {
		helper.addParam(PARAM_JACKPOT_IN_GAME, "1", "notify jackpot in game");
		helper.addParam(PARAM_JACKPOT_NOT_IN_NGAME, "2", "notify jackpot not in game");
	}

	@Override
	public String execute() {
		int index = helper.getCommandIndex(commandValue);

		switch (index) {
		case PARAM_JACKPOT_IN_GAME:
//			GameLobbyProcesser.sendJackpotNotify(player, JackpotEventType.IN_GAME, "some game", "some hall",
//					"bonus 0", GameUtility.randomInt(1, 99999), GameUtility.randomInt(1, 99999));
			GameLobbyProcesser.handleBroadcastJackpotNotify(getModule(), player, JackpotEventType.IN_GAME,
					"some game", "some hall", "bonus 0", GameUtility.randomInt(1, 99999),
					GameUtility.randomInt(1, 99999));
			return "ok";
		case PARAM_JACKPOT_NOT_IN_NGAME:
//			GameLobbyProcesser.sendJackpotNotify(player, JackpotEventType.NOT_IN_GAME, "some game", "some hall",
//					"bonus 0", GameUtility.randomInt(1, 99999), GameUtility.randomInt(1, 99999));
			GameLobbyProcesser.handleBroadcastJackpotNotify(getModule(), player, JackpotEventType.NOT_IN_GAME,
					"some game", "some hall", "bonus 0", GameUtility.randomInt(1, 99999),
					GameUtility.randomInt(1, 99999));
			return "ok";
		}

		return getDescription();
	}

	@Override
	public String getDescription() {
		return helper.getDescription();
	}

	@Override
	public String getName() {
		return "jackpot_notify";
	}

	/*
	 * @see com.ms.service.module.zone.command.BasicDebugCommand#getShortDescription()
	 */
	@Override
	public String getShortDescription() {
		return "send a fake jackpot broadcast message.";
	}
}
